<?php if (!defined('BASEPATH')) exit('No direct script access allowed');


/**
 * ATTENTION: Experimental Ajax so far
 *
 * @author febusch
 */
class Calendar extends CI_Controller {
    
    function __construct() {
        parent::__construct();
        
        $calSettings = array('start_day' => 'monday', 'show_next_prev' => 'TRUE');
        $calSettings['template'] = '{week_day_cell}<td class="wdc">{week_day}</td>{/week_day_cell}
                                    {cal_cell_no_content_today}<div class="highlight">{day}</div>{/cal_cell_no_content_today}
                                    {heading_previous_cell}<th><a href="'.base_url().'index.php/calendar/load/{previous_url}" id="prevMonth">&lt;&lt;</a></th>{/heading_previous_cell}
                                    {heading_next_cell}<th><a href="'.base_url().'index.php/calendar/load/{next_url}" id="nextMonth">&gt;&gt;</a></th>{/heading_next_cell}';
        // Set Cal Language to 'German'
        $this->lang->load('calendar', 'deutsch');
        $this->load->library('calendar', $calSettings);
        
    }
    
    function load($year = NULL, $month = NULL)
    {
        $output = $this->calendar->generate($year, $month);
        echo utf8_encode($output);
    }
}

?>
